<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	<base target="_self" />
		<title>欢迎访问产品运营互动中心！</title>
		<link rel="stylesheet" href="<s:url value="/css/style.css"/>">
		<script type="text/javascript"
			src="<s:url value="/script/sysOper.js"/>"></script>
	</head>
	<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
		<s:form action="/business/productDict/listProductDictSelect.action"
			method="post">

						<TABLE width="98%" border="0" cellspacing="0" cellpadding="0"
							align="center" class=tablecolor2>
							<tr>
								<td height="50">
									<div align="center">
										<a href="shareinfo.html" target="_blank">名称</a>
									</div>
								</td>
								<td>
									<input name="conds.productProperty" type="text"
										value="${conds.productProperty}" size="30" />
								</td>
								<td height="50">
									<div align="center">
										<a href="shareinfo.html" target="_blank">数据类型</a>
									</div>
								</td>
								<td>
									<input name="conds.dataType" type="text"
										value="${conds.dataType}" size="30" />
								</td>
								<td>
								    <input type="button" name="search" onclick="submit();"
										value="查 询">&nbsp;&nbsp;&nbsp;
								    <input type="button" name="new" value="确 定"
										onClick="sure()">
								</td>
							</tr>
						</TABLE>
						
						<table width="98%" border="0" cellspacing="0" cellpadding="7"
							align="center" class=tablecolor2>

							<tr>
								<td bgcolor="9AC2EB" width="10%">
									<div align="center">
										<font color="#FFFFFF">选择<label id="labSel"
												onclick="javascript:selAll('dCancel','dAll','ids');"
												style="cursor: hand">
												<div id="dAll">
													[全选]
												</div>
												<div id="dCancel" style="display: none">
													[取消]
												</div>
											</label> </font>
									</div>
								</td>
								<td bgcolor="9AC2EB">
									<div align="center">
										<font color="#FFFFFF">属性名称 </font>
									</div>
								</td>
								<td bgcolor="9AC2EB">

									<div align="center">
										<font color="#FFFFFF">关键值</font>
									</div>
								</td>
								<td bgcolor="9AC2EB">

									<div align="center">
										<font color="#FFFFFF">说 明</font>
									</div>
								</td>
								<td bgcolor="9AC2EB">

									<div align="center">
										<font color="#FFFFFF">创建人</font>
									</div>
								</td>
								<td bgcolor="9AC2EB">
									<div align="center">
										<font color="#FFFFFF">创建时间</font>
									</div>
								</td>
							</tr>
							<s:iterator value="productDicts">
								<tr>
									<td>
										<div align="center">
											<input type="checkbox" name="ids"
												value="<s:property value="id" />">
										    <input type="hidden" name="productPropertys"
												value="<s:property value="productProperty" />">
											<input type="hidden" name="keyValues"
												value="<s:property value="keyValue" />">
										</div>
									</td>
									<td>
										<div align="center">
											<s:property value="productProperty" />
										</div>
									</td>
									<td>
										<div align="center">
											<s:property value="keyValue" />
										</div>
									</td>
									<td>
										<div align="center">
											<s:property value="description" />
										</div>
									</td>
									<td>
										<div align="center">
											<s:property value="creator" />
										</div>
									</td>
									<td>
										<div align="center">
											<s:date name="begin" format="yyyy-MM-dd" />
										</div>
									</td>
								</tr>
							</s:iterator>
						</table>

						</s:form>
	</body>
</html>
<script>
function sure(){
            
	var infoIds=window.dialogArguments.document.getElementsByName("infoIds");
	var propertyTable=window.dialogArguments.document.getElementById("propertyTable");
	var idstr=",";
	for(i=0;i<infoIds.length;i++){
		idstr+=infoIds[i].value+",";
	}
	var ids=document.getElementsByName("ids");
	var productPropertys=document.getElementsByName("productPropertys");
	var keyValues=document.getElementsByName("keyValues");
	for(i=0;i<ids.length;i++){
	    if(ids[i].checked==true){
			if(idstr.indexOf(","+ids[i].value+",")!=-1){
				alert("产品属性:"+document.getElementsByName("productPropertys")[i].value+"已经存在");
				return;
			}
		}
	}
	for(i=0;i<ids.length;i++){
	    if(ids[i].checked==true){
	    	var tr=propertyTable.insertRow();
	    	var td0=window.dialogArguments.document.createElement("td");
	    	td0.innerHTML=productPropertys[i].value+"：";
	    	var td2=window.dialogArguments.document.createElement("td");
	    	td2.innerHTML="<textarea name='propertyValue' style='width:90%;height:50px'></textarea><div id='propertyValuetip' style='width:auto'></div><input type='hidden' name='infoIds' value='"+ids[i].value+"'/>";
	    	//td2.innerHTML="<input type='text' name='propertyValues' size='75'/><input type='hidden' name='infoIds' value='"+ids[i].value+"'/>";
	    	td0.align="right";
	    	td0.bgColor="D6E3FA";
	    	td2.align="left";
	    	tr.appendChild(td0);
	    	tr.appendChild(td2);
		}
	}
	window.close();
	                     
}
</script>
